#pragma once
#include "utility/GameMsg.h"

namespace RemoteUtility {
	namespace RemoteAdapter {
		using GameUtility::IMessageShower;
		enum E_ZMotion_ErrorCode {
			E_NOERROR,
			E_USB_NOT_CONNECTED,
			E_DRIVER_NOT_INSTALLED,
		};

		//this is just a interface for different remote controller
		class IRemoteAdapter
		{
		public:
			// factory method
			static IRemoteAdapter* createRemoteAdapter(IMessageShower* msgBox);
			IRemoteAdapter()
				: m_bDriverInstalled( false )
				, m_bUSBConnected( false )
			{ /* do nothing */ }
			virtual ~IRemoteAdapter(){ /* do nothing */ }
			virtual E_ZMotion_ErrorCode CheckRemoteDriver() = 0;
			virtual bool DoSearching() = 0;
			virtual bool IsInSearching() const = 0;
			virtual bool DoStopSearching() = 0;
			virtual bool DoInstall() = 0;
			virtual bool DoUninstall() = 0;
			virtual E_ZMotion_ErrorCode getErrorCode() const = 0;
			virtual void setErrorCode(E_ZMotion_ErrorCode) = 0;
			virtual void setMessageBox( IMessageShower* ) = 0;

			bool GetDriverInstalled() const { return m_bDriverInstalled; }
			bool GetUSBConnected() const { return m_bUSBConnected; }

		protected:
			bool m_bDriverInstalled;
			bool m_bUSBConnected;
		};
	} // end namespace RemoteAdapter
} // end namespace RemoteUtility
